Skip to content

firstpass 4x4x1 split#118

Draft
seanmcculloch wants to merge 4 commits intomainfrom
round-to-round
Draft

firstpass 4x4x1 split#118
seanmcculloch wants to merge 4 commits intomainfrom
round-to-round

Conversation

@seanmcculloch
Copy link
Copy Markdown
Collaborator

PUT YOUR LINK TO THE JIRA TICKET HERE

Description of the changes you made

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist of Requirements

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added unit tests
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Instructions for Testing

List dependencies, related tickets, or tasks

Additional screenshots or context

"""
# image_sizes, min_size = self.collect_image_sizes()
min_step_size = self.find_min_step_size()
# min_step_size = self.find_min_step_size()
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to bypass this function and use min_step_size = [1, 1, 1]. See issue #117

from_val = input_min[i]

while to_val < input[i]:
while to_val < input[i]-1:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added '-1' to the while loop condition here, because invervals are 0-indexed, while input (size of the dataset coming from the xml directly) is 1-indexed. This was causing it to create an extra last inerval after all of the proper ones (eg to_val was 479, the last pixel in 0-indexd , input[i] was 480)

size = l + size
return size

def last_image_size(self, L, S, O):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vibe-coded a replacement to last_image_size. My understanding is that this function should return the size of the last split-tile in the dimenstion. I was using parameters:
L=480 # total dimension length
S=192 # target split-tile size in this dimension
O=96 # size of overlap.

These parameters should perfectly tile with 4 tiles (1924) - (963) = 480. The function was returning 96. New function returns 192.

This now aligns with the use of the function's return value on line 144 "if last_image_size != s:" aka (if the tiling is not perfect).

if length <= self.target_image_size[i]:
pass
dim_intervals.append((0, length - 1))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the dimension is smaller than the target tiling size, add at least one interval that represents the entire dimension.

Without this, the cursor object below does not create any split-tiles.

channel = file_path.split("_ch_", 1)[1].split(".ome.zarr", 1)[0]

# channel = file_path.split("_ch_", 1)[1].split(".ome.zarr", 1)[0]
channel = 0 # Placeholder for channel extraction logic
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to bypass this channel logic that is based on file name. This should be removed so that there is no hard-coded enforcement of any filenames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant